<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // 1. 判断3的倍数
  var n = 0;
  if( n%3 || n === 0 ){
    console.log(n + "不是3的倍数");
  }else{
    console.log(n + "是3的倍数");
  }

  // 2. 判断3和7的公倍数
  var x = 0;
  if( x%3 === 0 && x%7 === 0 && n !== 0 ){
    console.log(x + "是3和7的公倍数")
  }else{
    console.log(x + "不是3和7的公倍数")
  }

  // 3. 判断一个字符串是否是纯数字（目前所学，无法绝对判断是否是纯数字，尽力即可）
  // var str = "hello";
  // var str = "hello123";
  // var str = "123hello";
  // var str = "12hello3";
  // var str = "0";
  var str = "345";
  if( parseFloat(str) != str ){
  // if( isNaN(str) ){
    console.log( str + "不是纯数字")
  }else{
    console.log( str + "是纯数字")
  }
  
  // 4. 根据月份判断本月有几天
  var m = 2;

  var result = "";
  switch( m ){
    case 2: result = "28天";break;
    case 4: 
    case 9: 
    case 11: 
    case 6: result = "30天";break;
    case 3: 
    case 1: 
    case 8: 
    case 10: 
    case 12: 
    case 5: 
    case 7: result = "31天";break;
  }

  console.log(m + "月的天数为：" + result);
</script>
</html>